﻿using System;
using System.Web.UI;
using BUS;

public partial class Register : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(Session["user"]!=null)
             ScriptManager.RegisterStartupScript(Page,Page.GetType(),"alert","alert('Bạn đã đăng nhập rồi.');window.location='Default.aspx';",true);
    }
    protected void btnSumit_Click(object sender, EventArgs e)
    {
        var khachHang = new KhachHangBUS
                            {                                
                                TenDangNhap = txtTenDangNhap.Text,
                                MatKhau = txtMatKhau.Text,
                                HoTen = txtHoTen.Text,
                                SoDienThoai = txtSoDienThoai.Text,
                                DiaChi = txtDiaChi.Text,
                                CMND = txtCMND.Text,
                                Email = txtEmail.Text,
                                CauHoi = txtCauHoi.Text,
                                TraLoi = txtTraLoi.Text
                            };

        App_Code.Account.Register(khachHang);
        MultiView1.SetActiveView(ViewDangKyThanhCong);

    }
}
